package com.factory.factorymethod.section6;

public class Client {
    public static void main(String[] args) throws Exception {
            new Thread(()->{
                try {
                    Product product1 = Factory.createProduct("Product1");
                    System.out.println(Thread.currentThread().getName()+":::::"+product1);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }).start();

            new Thread(() -> {
                try {
                    Product product1 = Factory.createProduct("Product1");
                    System.out.println(Thread.currentThread().getName()+":::::"+product1);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }).start();

        Product product1 = Factory.createProduct("Product1");
        System.out.println(Thread.currentThread().getName()+":::::"+product1);

    }
}
